package com.time.sky.mapper;

import com.time.sky.entity.JJBZ;
import org.apache.ibatis.annotations.*;

import java.util.List;
@Mapper
public interface JJBZMapper {
    @Select("SELECT * FROM JJBZ j LEFT JOIN GLTYPE g ON j.gid=g.gid where j.gid=1")
    List<JJBZ> selectGid1();
    @Select("SELECT * FROM JJBZ j LEFT JOIN GLTYPE g ON j.gid=g.gid where j.gid=2")
    List<JJBZ> selectGid2();
    @Select("SELECT * FROM JJBZ j LEFT JOIN GLTYPE g ON j.gid=g.gid where j.gid=3")
    List<JJBZ> selectGid3();
    @Select("SELECT * FROM JJBZ j LEFT JOIN GLTYPE g ON j.gid=g.gid where j.gid=4")
    List<JJBZ> selectGid4();
    @Insert("insert into JJBZ(glsf,nhsf,jcfw,ycfw,bzbm,bzmc,fykm,kmlx,jffs,price,sxsj,gid) " +
            "values(#{glsf},#{nhsf},#{jcfw},#{ycfw},#{bzbm},#{bzmc},#{fykm},#{kmlx},#{jffs},#{price},#{sxsj},#{gid})")
    void add(JJBZ jjbz);
    @Delete("delete from JJBZ where jid=#{jid}")
    void delete(int jid);
    @Select("SELECT * FROM JJBZ  where jid=#{jid}")
    JJBZ getById(int jid);
    @Update("update JJBZ set glsf=#{glsf},nhsf=#{nhsf},jcfw=#{jcfw},ycfw=#{ycfw},bzbm=#{bzbm},bzmc=#{bzmc},fykm=#{fykm},kmlx=#{kmlx},jffs=#{jffs},price=#{price},sxsj=#{sxsj},gid=#{gid} where jid=#{jid}")
    void update(JJBZ jjbz);
}
